package com.example.sneakerappforme1105.bean;

import androidx.annotation.NonNull;
import androidx.room.Entity;
import androidx.room.ForeignKey;
import androidx.room.PrimaryKey;

import java.util.Date;
@Entity(tableName = "tb_order"
//        foreignKeys = {
//            @ForeignKey(
//                    entity = User.class,
//                    parentColumns = "userId",
//                    childColumns = "userId",
//                    onDelete = ForeignKey.CASCADE
//            )
//        }
)
public class Order {
    @PrimaryKey(autoGenerate = true) // 该字段是自增主键
    @NonNull
    private long orderId;
    private long userId;   // 用户ID,外键
    private String status; // 订单状态 （待支付pay、已支付paid、已发货deliver、已完成、已取消等）
    private double totalAmount; // 总金额
    private String createdAt; // 下单时间
    private String address; // 收获地址
    private String paymentStatus;   // 支付状态 （待支付pay、已支付paid、发货deliver等）

    public Order(long userId, String status, double totalAmount, String createdAt, String address, String paymentStatus) {
        this.userId = userId;
        this.status = status;
        this.totalAmount = totalAmount;
        this.createdAt = createdAt;
        this.address = address;
        this.paymentStatus = paymentStatus;
    }

    public Order() {


    }

    public long getOrderId() {
        return orderId;
    }

    public void setOrderId(long orderId) {
        this.orderId = orderId;
    }

    public long getUserId() {
        return userId;
    }

    public void setUserId(long userId) {
        this.userId = userId;
    }

    public String getStatus() {
        return status;
    }

    public void setStatus(String status) {
        this.status = status;
    }

    public double getTotalAmount() {
        return totalAmount;
    }

    public void setTotalAmount(double totalAmount) {
        this.totalAmount = totalAmount;
    }

    public String getCreatedAt() {
        return createdAt;
    }

    public void setCreatedAt(String createdAt) {
        this.createdAt = createdAt;
    }

    public String getAddress() {
        return address;
    }

    public void setAddress(String address) {
        this.address = address;
    }

    public String getPaymentStatus() {
        return paymentStatus;
    }

    public void setPaymentStatus(String paymentStatus) {
        this.paymentStatus = paymentStatus;
    }
}
